package com.lw;

import java.awt.*;

/**
 * 背景
 */
public class Bg {

    void paintSelf(Graphics g,int myFishLevel){
        g.drawImage(GameUtils.bgImg, 0, 0, GameWin.WIDTH, GameWin.HEIGHT, null);
        switch (GameWin.state){
            case NOT_STARTED -> {//游戏未开始
                GameUtils.drawWord(g,"开始",Color.pink,60,GameWin.WIDTH/2-60,GameWin.HEIGHT/2-60);
            }
            case IN_PROGRESS -> {//游戏中
                //这里不是根据窗口的Width,Height计算出的x,y，最好还是根据计算来
                GameUtils.drawWord(g,"积分"+GameUtils.score,Color.orange,50,200,120);
                GameUtils.drawWord(g,"难度"+GameUtils.level,Color.orange,50,600,120);
                GameUtils.drawWord(g,"等级"+myFishLevel,Color.orange,50,1000,120);
            }
            case FAILED -> {
                GameUtils.drawWord(g,"积分"+GameUtils.score,Color.orange,50,200,120);
                GameUtils.drawWord(g,"难度"+GameUtils.level,Color.orange,50,600,120);
                GameUtils.drawWord(g,"等级"+myFishLevel,Color.orange,50,1000,120);
                GameUtils.drawWord(g,"失败",Color.red,80,GameWin.WIDTH/2-80,GameWin.HEIGHT/2-80);
            }
            case SUCCESS -> {//胜利
                GameUtils.drawWord(g,"积分"+GameUtils.score,Color.orange,50,200,120);
                GameUtils.drawWord(g,"难度"+GameUtils.level,Color.orange,50,600,120);
                GameUtils.drawWord(g,"等级"+myFishLevel,Color.orange,50,1000,120);
                GameUtils.drawWord(g,"胜利",Color.red,80,GameWin.WIDTH/2-80,GameWin.HEIGHT/2-80);
            }
            case PAUSED -> {
                GameUtils.drawWord(g,"积分"+GameUtils.score,Color.orange,50,200,120);
                GameUtils.drawWord(g,"难度"+GameUtils.level,Color.orange,50,600,120);
                GameUtils.drawWord(g,"等级"+myFishLevel,Color.orange,50,1000,120);
                GameUtils.drawWord(g,"游戏暂停",Color.red,80,GameWin.WIDTH/2-80,GameWin.HEIGHT/2-80);
            }
        }
    }
}
